//
//  IOS15SetStyleForButtonSet.swift
//  SwiftUIButton
//
//  Created by 李煜 on 2024/7/30.
//

import SwiftUI
//ios15 为按钮组设置样式
struct IOS15SetStyleForButtonSet: View {
    var body: some View {
        VStack {
            Button(action: {}, label: {
                Text("Add to Cart")
                    .font(.headline)
            })

            Button(action: {}, label: {
                Text("Discover")
                    .font(.headline)
                    .frame(maxWidth: 300)
            })
            Button(action: {}, label: {
                Text("Check out")
                    .font(.headline)

            })
        }
        .tint(.purple) // ios 15
        .controlSize(.large) // ios 15
        .buttonBorderShape(.capsule) // ios 15
        .buttonStyle(.bordered) // ios 13
    }
}

#Preview {
    IOS15SetStyleForButtonSet()
}
